Report honest removed flag from oauth.clients.remove - #1603
Merged
Conversation
The tool mapped an idempotent storage no-op to removed: true, so a typo'd slug, an already-deleted client and the wrong owner all read as a real deletion. Clients are keyed by (owner, slug), so a sweep under one hardcoded owner silently skipped the other scope's copies. The tool now checks the visible client set first; the service-level removeClient stays idempotent.
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 5dec04e | Commit Preview URL Branch Preview URL |
Aug 16 2026, 12:31 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 5dec04e | Aug 16 2026, 12:32 PM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1600, found by using it: while cleaning up 8 unused OAuth clients, one of the removals reported
{ removed: true }and deleted nothing. Only the arithmetic gave it away — 20 clients minus 8 removals left 13, not 12.oauth.removeClientis idempotent by design at the storage layer (deleteManyon a missing row is a no-op, which is correct for a delete), but the tool mapped that silence to unconditional success. So a typo'd slug, an already-deleted client, and the wrong owner were all indistinguishable from a real deletion. I confirmed the extreme case against production: removingdefinitely-not-a-real-clientalso returned{ removed: true }.It bites hardest because clients are keyed by both owner and slug, so the same slug can exist separately under
organduser. A sweep over a list of slugs with one hardcodedownerdeletes only the matching half and reports every call as success — which is exactly what happened: amicrosoft-graphOAuth app stayed registered underorgafter everything it authorized had been deleted.The tool now checks the caller-visible client set first and returns
removed: falsewhen nothing matched that(owner, slug)pair. The service-levelremoveClientis unchanged and stays idempotent — the honesty belongs at the agent boundary, matchingintegrations.removefrom #1600.Verification
oauth-remove-client.test.tscovers the exact shape that hid the bug: the same slug registered under both owners, removed one owner at a time, plus a never-existed slug and a repeat removal.expected { removed: true } to deeply equal { removed: false }.format:check,lint, repo-widetypecheckclean;packages/core/sdk599/599.Not in this PR
oauth.clients.listreturnsownerandslugas separate fields with no single unambiguous identifier, which is what let twomicrosoft-graphrows read as one entry when scanning the output. An owner-qualified address field would prevent that class of misread, but it changes an output schema, so it seemed worth deciding separately.